const express = require('express');
const router = express.Router();
const path = require('path');

/**
 * @swagger
 * /:
 *   get:
 *     tags: [Index]
 *     summary: 获取API基本信息
 *     responses:
 *       200:
 *         description: 成功返回API信息
 */
router.get('/', function(req, res) {
  res.json({
    name: '宠物商城管理系统 API',
    version: '1.0.0',
    description: '提供宠物商城管理系统的所有后端服务',
    endpoints: {
      users: '/api/users',
      pets: '/api/pets',
      products: '/api/products',
      orders: '/api/orders'
    }
  });
});

/* GET home page. */
router.get('/', function(req, res) {
  res.sendFile(path.join(__dirname, '../public/index.html'));
});

module.exports = router;
